package com.woniuxy.kaer.tenants.feign;

import com.woniuxy.kaer.commons.util.Result;
import com.woniuxy.kaer.tenants.dto.FoundInfoDto;
import com.woniuxy.kaer.tenants.dto.ShopInfoDto;
import com.woniuxy.kaer.tenants.feign.impl.TenantsFeignClientImpl;
import com.woniuxy.kaer.tenants.from.ChangeShopScoreFrom;
import com.woniuxy.kaer.tenants.from.UpdateShopScoreFrom;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "tenants-server",fallback = TenantsFeignClientImpl.class)
public interface TenantsFeignClient {
    @GetMapping("/tenants/shopInfo/getShopInfoByShopId")
    public Result<ShopInfoDto> getShopInfoByShopId(@RequestParam("shopId")Integer shopId)throws Exception;

    @PutMapping("/tenants/shopInfo/updateShopScore")
    public Result updateShopScore(@RequestBody UpdateShopScoreFrom from)throws Exception;

    @GetMapping("/tenants/founder/getFounderById")
    public Result<FoundInfoDto> getFounderById(@RequestParam("founderId")Integer founderId)throws Exception;

    @GetMapping("/tenants/shopInfo/getShopInfoByFounderId")
    public Result<ShopInfoDto> getShopInfoByFounderId(@RequestParam("founderId")Integer founderId)throws Exception;
    @GetMapping("/tenants/shopInfo/getAllShopInfo")
    public Result<List<ShopInfoDto>> getAllShopInfo()throws Exception;

    @PostMapping("/tenants/shopInfo/shopServiceCount")
    public Result shopServiceCount(@RequestBody ChangeShopScoreFrom from)throws Exception;

}
